home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
U-User Group
/
(k)u6.d64
/
wait'n'go.proc
< prev
next >
Wrap
Text File
|
2007-02-28
|
701b
|
28 lines
0010 // LIST "0:WAIT'N'GO.PROC"
0020 //
0030 DIM RESP$ OF 1
0040 PRINT "┘OU'VE GOT 6 SECONDS TO REPLY"
0050 KEY'WAIT'N'GO(6,RESP$)
0060 IF RESP$=CHR$(0) THEN
0070 PRINT "┘OU BLEW IT"
0080 ELSE
0090 PRINT "┘OU GOT IT"
0100 ENDIF
0110 END
0120 // ** ╫AIT ON KEY PRESS FOR 'X' SECONDS AND GO ON IF NOT PRESSED **
0130 PROC KEY'WAIT'N'GO(X,REF RESP$) CLOSED
0140 DIM NUL$ OF 1
0150 NUL$:=CHR$(0)
0160 END'TIME:=JIFFIES+60*X
0170 REPEAT
0180 RESP$:=KEY$
0190 UNTIL RESP$<>NUL$ OR JIFFIES>END'TIME
0200 ENDPROC KEY'WAIT'N'GO
0210 //
0220 // ** RETURN SYSTEM TIME IN JIFFIES **
0230 FUNC JIFFIES CLOSED
0240 SYSTIM:=PEEK(162)+256*(PEEK(161)+256*PEEK(160))
0250 RETURN SYSTIM
0260 ENDFUNC JIFFIES
0270 //